Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / EnvironmentMetrics.kt

Displaying Raw • Download

core/model/src/commonMain/kotlin/org/meshtastic/core/model/EnvironmentMetrics.kt 4e15ef1c7f68f8c683fe8b7ff741a5167e154d2e (4e15ef1c) Text, 2.67 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model

Tff7b72import T7ee787org.meshtastic.core.common.util.nowSeconds

Tff7b72data Tff7b72class T56d364EnvironmentMetricsTb4b4b4(
Tff7b72val Te6edf3timeTb4b4b4: Tffa657Int Tff7b72= Te6edf3currentTimeTb4b4b4(Tb4b4b4)Tb4b4b4, T8b949e// default to current time in secs (NOT MILLISECONDS!)
Tff7b72val Te6edf3temperatureTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3relativeHumidityTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3soilTemperatureTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3soilMoistureTb4b4b4: Tffa657Int?Tb4b4b4,
Tff7b72val Te6edf3barometricPressureTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3gasResistanceTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3voltageTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3currentTb4b4b4: Tffa657Float?Tb4b4b4,
Tff7b72val Te6edf3iaqTb4b4b4: Tffa657Int?Tb4b4b4,
Tff7b72val Te6edf3luxTb4b4b4: Tffa657Float? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3uvLuxTb4b4b4: Tffa657Float? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffMagicNumberTa5d6ff"Tb4b4b4)
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72fun Td2a8ffcurrentTimeTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3nowSecondsTb4b4b4.Te6edf3toIntTb4b4b4(Tb4b4b4)

Tff7b72fun Td2a8fffromTelemetryProtoTb4b4b4(Te6edf3protoTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3EnvironmentMetricsTb4b4b4, Te6edf3timeTb4b4b4: Tffa657IntTb4b4b4)Tb4b4b4: Te6edf3EnvironmentMetrics Tff7b72=
Te6edf3EnvironmentMetricsTb4b4b4(
Te6edf3temperature Tff7b72= Te6edf3protoTb4b4b4.Te6edf3temperatureTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
T8b949e// 0%RH is treated as "no reading" — firmware emits 0 when the humidity sensor isn't fitted and a real
T8b949e// outdoor reading of exactly 0%RH is physically implausible. Other fields don't get this guard because
T8b949e// their natural zero values (0 V, 0 A, 0°C) are meaningful sensor data.
Te6edf3relativeHumidity Tff7b72= Te6edf3protoTb4b4b4.Te6edf3relative_humidityTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tff7b72&Tff7b72& Tffa657it Tff7b72!Tff7b72= T79c0ff0.0f Tb4b4b4}Tb4b4b4,
Te6edf3soilTemperature Tff7b72= Te6edf3protoTb4b4b4.Te6edf3soil_temperatureTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3soilMoisture Tff7b72= Te6edf3protoTb4b4b4.Te6edf3soil_moistureTff7b72?.Te6edf3takeIf Tb4b4b4{ Tffa657it Tff7b72!Tff7b72= Tffa657IntTb4b4b4.Te6edf3MIN_VALUE Tb4b4b4}Tb4b4b4,
Te6edf3barometricPressure Tff7b72= Te6edf3protoTb4b4b4.Te6edf3barometric_pressureTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3gasResistance Tff7b72= Te6edf3protoTb4b4b4.Te6edf3gas_resistanceTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3voltage Tff7b72= Te6edf3protoTb4b4b4.Te6edf3voltageTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3current Tff7b72= Te6edf3protoTb4b4b4.Te6edf3currentTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3iaq Tff7b72= Te6edf3protoTb4b4b4.Te6edf3iaqTff7b72?.Te6edf3takeIf Tb4b4b4{ Tffa657it Tff7b72!Tff7b72= Tffa657IntTb4b4b4.Te6edf3MIN_VALUE Tb4b4b4}Tb4b4b4,
Te6edf3lux Tff7b72= Te6edf3protoTb4b4b4.Te6edf3luxTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3uvLux Tff7b72= Te6edf3protoTb4b4b4.Te6edf3uv_luxTff7b72?.Te6edf3takeIf Tb4b4b4{ Tff7b72!Tffa657itTb4b4b4.Te6edf3isNaNTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3time Tff7b72= Te6edf3timeTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.05s